<?php
/**
 * Setup a global Zend_View object using Admin package
 *
 * @package Admin_Library
 * @subpackage Admin_Library_View
 */
class Admin_Library_View
{
    /**
	 * @var Zend_View
	 */
    public $view;
	
    /**
	 * Constructor extension 
	 * 
	 * @param Zend_View $view
	 * @return Admin_Library_View
	 */
	public function __construct($view)
	{
		$this->view = $view;
	}
	
	/**
	 * Constructor extension
	 * @return Zend_View
	 */
	public function init()
	{
	    //$this->view->addFilterPath('Custom/View/Filter', 'Custom_View_Filter');
        //$this->view->setFilter('Translate');
	    
    	// set encoding and doctype
		$this->view->setEncoding('UTF-8');

		$this->view->doctype('XHTML1_STRICT');

		// set the content type and language
		$this->view->headMeta()
			       ->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');
		
		$this->view->headMeta()
				   ->appendHttpEquiv('Content-Language', 'en-US');

		// setting the site in the title
		$this->view->headTitle('HIDGE System');
		//	setting a separator string for segments:
		$this->view->headTitle()->setSeparator(' - ');
		
		// attach jquery JS library as the initial to admin-pages
		$this->view->headScript()->appendFile($this->view->baseUrl() . '/js/jquery/jquery-1.4.2.min.js');
		// attach default CSS to admin-pages
		$this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/style_admin.css');
		//$this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/css/style_admin_ie7.css', 'all', 'IE 7');
		// setup menu bar, navigation ...
		$config = new Zend_Config_Xml(MODULE_PATH . '/admin/configs/navigation.xml', 'nav');
        $container = new Zend_Navigation($config);
        $this->view->navigation($container);
		
		return $this->view;
	}
}